﻿using System;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace VisualPureBasicIDE.CoreGUI
{
    public partial class WindowListForm : Form
    {
        readonly DockPanel _dockPanel;
        public WindowListForm(DockPanel dockPanel)
        {
            _dockPanel = dockPanel;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void formWndList_Load(object sender, EventArgs e)
        {
            listView1.Groups.Add("unbound", "Unbound files");
            foreach (var cnt in _dockPanel.Documents)
            {
                listView1.Items.Add(cnt.DockHandler.TabText);
                listView1.Items[listView1.Items.Count - 1].Group = listView1.Groups[0];
            }
        }
    }
}